//package com.fusion.redis.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.data.redis.listener.PatternTopic;
//import org.springframework.data.redis.listener.RedisMessageListenerContainer;
//import org.springframework.data.redis.listener.adapter.MessageListenerAdapter;
//
//import com.fusion.redis.service.RedisMessageService;
//
//@Configuration
//public class RedisSubListenerConfig2 {
//	
//	@Bean
//	RedisMessageListenerContainer container(LettuceConnectionFactory factory,MessageListenerAdapter listenerAdapter) {
//		factory.setShareNativeConnection(false);
//		factory.getConnection().select(4);
//		RedisMessageListenerContainer container = new RedisMessageListenerContainer();
//		container.setConnectionFactory(factory);
//		container.addMessageListener(listenerAdapter, new PatternTopic("task"));
//		container.addMessageListener(listenerAdapter, new PatternTopic("test"));
//		return container;
//	}
//
//	@Bean
//	MessageListenerAdapter listenerAdapter(RedisMessageService redisMessageService) {
//		return new MessageListenerAdapter(redisMessageService, "getRedisMessage");
//	}
//
//	@Bean
//	StringRedisTemplate template(LettuceConnectionFactory factory) {
//		factory.setShareNativeConnection(false);
//		factory.getConnection().select(5);
//		return new StringRedisTemplate(factory);
//	}
//}
